home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Bus / T-Z / VCR+(app+src) Folder / Sources / decoder.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-16  |  980 b   |  52 lines  |  [TEXT/KAHL]

  1. #include "VCRplus.h"
  2.  
  3. extern    vcrInfo    myVCR;
  4.  
  5. void decoder(void)
  6. {
  7.     long     s1_out, bot3, top5, quo, rem ;
  8.     long     s5_out, mtout, ofout, tval, cval ;
  9.     long     day_out;
  10.     
  11.     Str32    tempStr;
  12.  
  13.  
  14.     ofout = INVALID ;
  15.     mtout = INVALID ;
  16.  
  17.     s1_out = f1(myVCR.code);
  18.     bot3 = s1_out % 1000;
  19.     top5 = s1_out / 1000;
  20.     quo = (bot3 - 1) / 32 ;
  21.     rem = (bot3 - 1) % 32 ;
  22.     day_out = quo + 1;
  23.  
  24.     if(myVCR.code >= 1000)
  25.         offset(day_out, myVCR.year, top5, (&ofout), (&mtout)) ;
  26.     else
  27.     {
  28.         mtout = 0;
  29.         ofout = 0;
  30.     }
  31.  
  32.     s5_out = (rem + (day_out*(myVCR.month+1)) + ofout) % 32 ;
  33.  
  34.  
  35.     bit_shuffle(mtout, s5_out, &tval, &cval);
  36.     myVCR.channel = cval + 1;
  37.     lookup(tval, (&myVCR.startTime), (&myVCR.duration));
  38.     
  39.     myVCR.day = day_out;
  40.     NumToString(myVCR.day, tempStr);
  41.     SetDText(dlgDAY, tempStr);
  42.     
  43.     NumToString(myVCR.channel, tempStr);
  44.     SetDText(dlgCHANNEL, tempStr);
  45.     
  46.     NumToString(myVCR.startTime, tempStr);
  47.     SetDText(dlgSTARTTIME, tempStr);
  48.     
  49.     NumToString(myVCR.duration, tempStr);
  50.     SetDText(dlgDURATION, tempStr);
  51. }
  52.